package com.laboratory.report.lab02.lab0203;

import lombok.Data;

/**
 * 动物
 */
@Data
public abstract class Animal {

    /**
     * 种类
     */
    protected String type;

    /**
     * 腿条数
     */
    protected int legs;

    public Animal(String type, int legs) {
        this.type = type;
        this.legs = legs;
    }

    public abstract void eat();
    public void walk() {
        System.out.println(type + "用 " + legs + " 条腿走路");
    }
}
